package com.lsh.controller;

import com.lsh.dao.db1.UserMapper;
import com.lsh.dao.db2.BlogMapper;
import com.lsh.entity.BlogBean;
import com.lsh.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ：LiuShihao
 * @date ：Created in 2020/6/23 9:12 上午
 * @desc ：
 */
@RestController
public class TestController {
    @Autowired
    UserMapper userMapper;
    @Autowired
    BlogMapper blogMapper;
    @GetMapping("/getUser")
    public List<User> fingUser(){
        return userMapper.findUser();
    }

    @GetMapping("/getBlog")
    public List<BlogBean> fingBlog(){
        return blogMapper.findBlog();
    }

    @DeleteMapping("/delUser")
    public int delUser(int i){
      int j   = userMapper.delUser(i);
      return j;
    }
    @DeleteMapping("/delBlog")
    public int delBlog(int i){
      int j   = blogMapper.delBlog(i);
      return j;
    }
}
